﻿using LPLS.Commons.DBModule;
using LPLS.DBEntities;
using LPLS.DBEntities.LongGIModule;
using LPLS.DBInterface.LongGiMoudle;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LPLS.DBServices.LongGiMoudle
{
    public class KaJiangDataService : DBBaseService, IKaJiangDataService
    {
        public KaJiangDataService(DBContext dbContext) : base(dbContext)
        {
        }

        public List<KaJiangData> GetData(string GoongYi, string TubeName, DateTime stime, DateTime etime)
        {
         return  this.Client.Queryable<KaJiangData>().
                Where(e=>e.TechnologyName==GoongYi&&e.Time>=stime&&e.Time<=etime&&e.TubeName==TubeName)
                .ToList();
        }

        public override void InitDataBaseName()
        {
            DataBaseName = DatabaseEnum.LongGiDB.ToString();
        }

        public int InsertData(List<KaJiangData> li)
        {
            return this.Client.Insertable(li).ExecuteCommand();
        }
    }
}
